-- MedAssist Clinic Management System
-- Index creation for performance tuning
USE `medassets`;

CREATE INDEX `idx_appointment_patient`
ON `appointment` (`PatientID`);

CREATE INDEX `idx_appointment_doctor_date`
ON `appointment` (`DoctorID`,`AppointmentDate`);

CREATE INDEX `idx_appointment_date`
ON `appointment` (`AppointmentDate`);

CREATE INDEX `idx_patient_name`
ON `patient` (`LastName`,`FirstName`);

CREATE INDEX `idx_treatment_appointment`
ON `treatment` (`AppointmentID`);

-- The original dump already included these indexes.
-- They are listed separately here to demonstrate performance tuning.
